home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 31 / Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso / -seriously_amiga- / emulation / emunet / install_for_amitcp < prev   
Text File  |  1998-07-16  |  4KB  |  149 lines

  1. .k CPU,NOADD
  2. .bra {
  3. .ket }
  4. ;--------------------------------------------------------
  5. ; Simple install script for EmuNet SANA-2 Device driver
  6. ; Assign AmiTCP: pointing to right place before running this!
  7. ; If you should run this again use NOADD switch to 
  8. ; prevent installing device entry multiple times.
  9. ;--------------------------------------------------------
  10. if "$INSTEMUNET" not eq "GIVEUSAGE"
  11.  setenv INSTEMUNET GIVEUSAGE
  12.  echo ""
  13.  echo "" 
  14.  echo "First run hint.. restart after reading the usage info."
  15.  echo ""
  16.  echo ""
  17.  skip usage
  18. endif
  19.  
  20. if "{CPU}" eq "?"
  21.  skip usage
  22. endif
  23. assign >NIL: AmiTCP: exists 
  24. if warn
  25.  echo "Please assign AmiTCP: first before running this."
  26.  skip usage
  27. endif
  28.  
  29. if "{CPU}" eq ""
  30.  setenv EMNDEVNAME emunet.device_020
  31. else
  32. if "{CPU}" eq "000"
  33.  setenv EMNDEVNAME emunet.device
  34. else
  35. if "{CPU}" eq "020"
  36.  setenv EMNDEVNAME emunet.device_020
  37. else
  38.  echo "Give CPU name as 000 or 020"
  39.  skip finish
  40. endif
  41. endif
  42. endif
  43.  
  44.  
  45. ;--------------------------------------------------------
  46. ; Check for necessary files
  47. ;--------------------------------------------------------
  48. if "{NOADD}" not eq "" 
  49.   skip noadds1
  50. endif
  51. if not exists db/interfaces_ADD
  52.  echo "Can't find db/interfaces_ADD"
  53.  skip usage
  54. endif
  55. lab noadds1
  56. if not exists bin/EMN_StartNet
  57.  echo "Can't find bin/EMN_Startnet script"
  58.  skip usage
  59. endif
  60. if not exists env/sana2/emunet.config
  61.  echo "Can't find emunet.config file"
  62.  quit 11
  63. endif
  64.  
  65. if "{NOADD}" not eq ""
  66.  skip noadds2
  67. endif
  68. if exists AmiTCP:db/interfaces
  69.   echo "Adding emn0 device to AmiTCP:db/interfaces"
  70.   type db/interfaces_ADD >>AmiTCP:db/interfaces
  71.   echo "Done."
  72. endif
  73. lab noadds2
  74. ;--------------------------------------------------------
  75.  
  76. if not exists devs/networks/$EMNDEVNAME
  77.  echo "Can't find devs/networks/$EMNDEVNAME"
  78.  skip usage
  79. endif
  80.  
  81. if exists DEVS:Networks/emunet.device
  82.  echo "Renaming old emunet.device as DEVS:Networks/emunet.device.OLD"
  83.  copy DEVS:Networks/emunet.device DEVS:Networks/emunet.device.OLD CLONE
  84.  protect DEVS:Networks/emunet.device +rwed
  85.  echo "Done."
  86. endif
  87.  
  88. echo "Installing $EMNDEVNAME driver to DEVS:Networks/emunet.device"
  89. copy devs/networks/$EMNDEVNAME DEVS:Networks/emunet.device CLONE
  90.  
  91.  
  92. ;--------------------------------------------------------
  93. ; Create backups of existing files
  94. ;--------------------------------------------------------
  95. if exists AmiTCP:bin/EMN_StartNet
  96.   echo "Renaming old startup script to EMN_StartNet.OLD"
  97.   copy AmiTCP:bin/EMN_StartNet AmiTCP:bin/EMN_StartNet.OLD CLONE
  98.   protect AmiTCP:bin/EMN_StartNet +rwed
  99.   echo "Done."
  100. endif
  101. if exists ENVARC:sana2/emunet.config
  102.    echo "Renaming old config file to ENVARC:sana2/emunet.config.OLD"
  103.    copy ENVARC:sana2/emunet.config ENVARC:sana2/emunet.config.OLD CLONE
  104.    echo "Done"
  105.    protect ENVARC:sana2/emunet.config +rwed
  106. endif
  107. if exists ENV:sana2/emunet.config
  108.   copy  ENV:sana2/emunet.config ENV:sana2/emunet.config.OLD CLONE
  109. failat 21
  110. ;* HappyEnv handler seems to be not supporting file  protection flags
  111. ; so do not fail for this small error if the user has this installed.
  112.   protect >NIL: ENV:sana2/emunet.config +rwed
  113. failat 20
  114.   delete >NIL: ENV:sana2/emunet.config
  115. endif
  116. ;--------------------------------------------------------
  117. ; Install sample config & startnet scripts
  118. ;--------------------------------------------------------
  119. echo "Installing sample configuration file emunet.config to ENVARC:sana2/ & ENV:sana2/"
  120. copy env/sana2/emunet.config ENVARC:sana2/ CLONE
  121. copy env/sana2/emunet.config ENV:sana2/ CLONE
  122. echo "Done."
  123.  
  124. echo "Installing example startup script EMN_StartNet to AmiTCP:bin/"
  125. copy bin/EMN_StartNet AmiTCP:bin/ CLONE
  126. protect AmiTCP:bin/EMN_StartNet +s
  127. echo "Done."
  128. ;--------------------------------------------------------
  129. ; Whell some advice is always necessary :)
  130. ;--------------------------------------------------------
  131. echo ""
  132. echo ""
  133. echo "Please read documentation to learn how to install the PC driver"
  134. echo ""
  135. echo ""
  136. unsetenv INSTEMUNET
  137. skip finish
  138.  
  139. lab usage
  140. echo "This script has to be run from the directory,"
  141. echo "where you extracted the archive!"
  142. echo ""
  143. echo "Please assign AmiTCP: first before running this."
  144. echo "Supply your CPU type, as this script defaults to 68020"
  145. echo "Usage: install_for_amitcp [000|020] [NOADD] [NODEV] "
  146.  
  147. lab finish
  148.  
  149.